/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package upc.jfactory.scp.jpa.bean;

import java.io.Serializable;
import java.sql.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;

import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
/**
 *
 * @author Diego
 */
@Entity
@Table(name = "Postulacion", catalog = "DAEPIFS_DB", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "Postulacion.findAll", query = "SELECT p FROM Postulacion p"),
    @NamedQuery(name = "Postulacion.findByPostulacionId", query = "SELECT p FROM Postulacion p WHERE p.postulacionId = :postulacionId"),
    @NamedQuery(name = "Postulacion.findByOfertaempresaId", query = "SELECT p FROM Postulacion p WHERE p.ofertaempresaId = :ofertaempresaId"),
    @NamedQuery(name = "Postulacion.findByPostulanteId", query = "SELECT p FROM Postulacion p WHERE p.postulanteId = :postulanteId"),
    @NamedQuery(name = "Postulacion.findByPostulanteEmpresaId", query = "SELECT p FROM Postulacion p WHERE p.postulanteId = :postulanteId AND p.ofertaempresaId = :ofertaempresaId"),
    @NamedQuery(name = "Postulacion.findByExperiencia", query = "SELECT p FROM Postulacion p WHERE p.experiencia = :experiencia"),
    @NamedQuery(name = "Postulacion.findByFechaAplicacion", query = "SELECT p FROM Postulacion p WHERE p.fechaAplicacion = :fechaAplicacion"),
    @NamedQuery(name = "Postulacion.findByPrioridad", query = "SELECT p FROM Postulacion p WHERE p.prioridad = :prioridad")})

public class Postulacion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "postulacion_id", nullable = false)
    private Integer postulacionId;
    @Basic(optional = false)
    @Column(name = "ofertaempresa_id", nullable = false)
    private int ofertaempresaId;
    @Basic(optional = false)
    @Column(name = "postulante_id", nullable = false)
    private int postulanteId;
    @Lob
    @Column(name = "descripcion")
    private String descripcion;
    @Column(name = "experiencia")
    private Boolean experiencia;
    @Column(name = "fecha_aplicacion")
    private Date fechaAplicacion;
    @Column(name = "prioridad")
    private Short prioridad;

    public Postulacion() {
    }

    public Postulacion(Integer postulacionId) {
        this.postulacionId = postulacionId;
    }

    public Postulacion(Integer postulacionId, int ofertaempresaId, int postulanteId) {
        this.postulacionId = postulacionId;
        this.ofertaempresaId = ofertaempresaId;
        this.postulanteId = postulanteId;
    }

    public Integer getPostulacionId() {
        return postulacionId;
    }

    public void setPostulacionId(Integer postulacionId) {
        this.postulacionId = postulacionId;
    }

    public int getOfertaempresaId() {
        return ofertaempresaId;
    }

    public void setOfertaempresaId(int ofertaempresaId) {
        this.ofertaempresaId = ofertaempresaId;
    }

    public int getPostulanteId() {
        return postulanteId;
    }

    public void setPostulanteId(int postulanteId) {
        this.postulanteId = postulanteId;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public Boolean getExperiencia() {
        return experiencia;
    }

    public void setExperiencia(Boolean experiencia) {
        this.experiencia = experiencia;
    }

    public Date getFechaAplicacion() {
        return fechaAplicacion;
    }

    public void setFechaAplicacion(Date fechaAplicacion) {
        this.fechaAplicacion = fechaAplicacion;
    }

    public Short getPrioridad() {
        return prioridad;
    }

    public void setPrioridad(Short prioridad) {
        this.prioridad = prioridad;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (postulacionId != null ? postulacionId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Postulacion)) {
            return false;
        }
        Postulacion other = (Postulacion) object;
        if ((this.postulacionId == null && other.postulacionId != null) || (this.postulacionId != null && !this.postulacionId.equals(other.postulacionId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "upc.jfactory.scp.jpa.bean.Postulacion[postulacionId=" + postulacionId + "]";
    }

}
